<table width="100%" id="units_list">
  <tr>
    <td class="RightAlign">
    	<form action="" method="post">
    	sort By:
    	<select name="sort" onchange="this.form.submit();">
    		<option value="">-- Sort By --</option>
    		<option value="price">Prices From</option>
    		<option value="people">No of people</option>
    		<option value="city">City</option>
    		<option value="country">Country</option>
    	</select>
    	</form> 
    </td>
  </tr>
  <?php if($units){?>
  	<?php foreach ($units as $key=>$unit){?>
	  <tr class="<?php echo($key%2 == 0 ? 'odd' : 'even');?>">
	    <td>
	    	<table border=0 width="100%">
			  <tr>
			    <td colspan="2">
			    	<a class="TitleLink" href="?option=com_resman&PropertyId=<?php echo $unit->id;?>"><?php echo $unit->title?></a><br />
			    	<span class="Navigation"><a href="?option=com_resman&category=<?php echo $unit->categories->id;?>"><?php echo $unit->categories->name;?></a> // <a href="?option=com_resman&city=<?php echo $unit->city;?>"><?php if($unit->city) echo $unit->city;?></a></span>
			    	<span class="PropertyId"> -- Property: <?php echo $unit->id;?></span>
			    </td>
			    <td valign="top">Prices From: <b>$ <?php echo ($unit->min_price ? $unit->min_price: "N/A" );?></b></td>
			  </tr>
			  <tr>
			    <td valign="top" width="20%" rowspan="2" class="CenterAlign">
			    	<img alt="<?php echo $unit->name;?>" src="<?php echo ADMIN_COMPONENT_PATH.$thumbs[$key]?>" width="100px">
			    </td>
			    <td valign="top">
			    	<?php echo ( strlen($unit->description) > $no_of_chars_in_desc ? substr($unit->description, 0, $no_of_chars_in_desc)." ..." : $unit->description );?><br /><br />
			    </td>
			    <td width="18%" class="CenterAlign" valign="middle" rowspan="2"><span class="BedInfo"><?php echo $unit->bedrooms . "<br /><br />Beds"?></span></td>
			  </tr>
			  <tr>
			  	<td valign="bottom"><a href="?option=com_resman&PropertyId=<?php echo $unit->id;?>">Read More...</a></td>
			  </tr>
			</table>
	    </td>
	  </tr>
  	<?php }?>
  <?php }else{?>
  	  <tr>
  	  	<td>There are no homes currently listed in this site</td>
  	  </tr>
  <?php }?>
</table>
<script type="text/javascript">
</script>